Summary
A networkable dictionary for use with the <see cref="T:Sandbox.SyncAttribute" /> and <see cref="T:Sandbox.HostSyncAttribute" />. Only changes will be
networked instead of sending the whole dictionary every time, so it's more efficient.
<br /><para><b>Example usage:</b><code>
public class MyComponent : Component
{
[Sync] public NetDictionary<string,bool> MyBoolTable { get; set; } = new();
<br />
public void SetBoolState( string key, bool state )
{
if ( IsProxy ) return;
MyBoolTable[key] = state;
}
}
</code></para>
Properties
Count |
<inheritdoc cref="P:System.Collections.ObjectModel.ObservableDictionary`2.Count" /> |
Item |
|
Keys |
<inheritdoc cref="P:System.Collections.ObjectModel.ObservableDictionary`2.Keys" /> |
Values |
<inheritdoc cref="P:System.Collections.ObjectModel.ObservableDictionary`2.Values" /> |
Methods